import request from './request'

const IS_PROD = process.env.NODE_ENV === 'production'

const api = IS_PROD ? '' : '/api'

export default {
  // 查询账户余额
  getAmount: (params = {}) =>
    request.get(
      `${api}/cosmos/bank/v1beta1/balances/${params.fromAddress}/by_denom?denom=uplugcn`
    ),

  // 获取下单明细记录
  getRecordList: (params = {}) =>
    request.get(
      `${api}/cosmos/tx/v1beta1/txs?events=message.module=%27bank%27&events=transfer.sender=%27${params.fromAddress}%27&pagination.limit=${params.size}&pagination.offset=${params.page}`
    ),

  // 查询中奖情况
  searchGet: (params = {}) => request.get(`${api}/block`, params),
}
